package kr.hkit.powerjava.chapter07;

public class StringTest {
	public static void main(String[] args){
		String str1 = "Aello Java"; //Hello Java 인덱스 0~9까지 
		String str2 = "AbSQL";	// 인덱스 0~4
		String str3 = "mysql";
		char moonja='m';
		try{
			char ch = str1.charAt(8);
			System.out.println(ch);
			
			System.out.println(str1.compareTo(str2)==0?"같음":str1.compareTo(str2));
			
			System.out.println(str1.concat(str2));
			
			System.out.println(str1.equals(str2)?"같음":"다름");

			System.out.println(str2.equals(str3)?"같음":"다름");
			System.out.println(str2.equalsIgnoreCase(str3)?"같음":"다름");
			
			System.out.println(str1.isEmpty());
			System.out.println("".isEmpty());
			System.out.println(str1.length());
			System.out.print("대문자 변환 : " + str1.toUpperCase());
			System.out.print("소문자 변환 : " + str1.toLowerCase());
			
			for(int i = 0; i<str1.length(); i++){
				System.out.print((str1.charAt(i)));
			}
			System.out.println(str1.replace('l',  'L'));
			System.out.println(str1.substring(6,8));
		}catch(IndexOutOfBoundsException e){ // 예외처리문...10이 넘어가면 오류라고 출력
			System.out.println("인덱스는 o~"+ str1.length()+"까지 가능");
		}
/*		System.out.println(ch);*/
		System.out.println((int) moonja);
	}
}
